"""          
Time : 2024/6/6 下午2:51
Author : TJC
@FileName: page_sk.py
@Desc: 水库项目page
"""
import allure
from page_base.page_base import Base
from page_element import el_gxhy_sk


class PageSk(Base):

    def page_input_username(self, username):
        self.base_input(el_gxhy_sk.login_username, username)

    def page_input_password(self, password):
        self.base_input(el_gxhy_sk.login_password, password)

    def page_right_code(self):
        """按压200毫秒和滑动1000毫秒的参数"""
        self.base_keep_press_and_slide_for_captcha(el_gxhy_sk.login_right_code, 200, 1000)

    def page_click_sk_btn(self):
        self.base_click(el_gxhy_sk.login_btn_click)

    def page_get_info(self):
        """获取登录后提示信息"""
        return self.base_get_text(el_gxhy_sk.login_value)


    def page_sk(self, username, password):
        with allure.step("输入用户名"):
            self.page_input_username(username)
        with allure.step("输入密码"):
            self.page_input_password(password)
        with allure.step("滑动验证码"):
            self.page_right_code()
        with allure.step("点击登录按钮"):
            self.page_click_sk_btn()